public class Student{
   
   private final int studentID;
   private String studentName;
   private String major;
   private double gpa;
   
   public Student(int id){
        studentID = id;	
   }
    
   public Student(int id, String name, String theMajor, double theGpa){
    	studentID = id;
    	studentName = name;
    	major = theMajor;
      gpa = theGpa;	
    }
      
    // Accessor or getter methods:
    public int getStudentID(){
    	return studentID;
    }
    
    public String getStudentName(){
    	return studentName;
    }
    
    public String getMajor(){
    	return major;
    }
    
    public double getGPA(){
    	return gpa;
    }
    
    // Mutator or setter methods:
    
    public void setStudentName(String theName){
    	studentName = theName;
    }
    
    public void setStudentMajor(String theMajor){
    	major = theMajor;
    }
    
    public void setStudentGPA(double theGPA) throws IllegalArgumentException{
      if(theGPA < 0 || theGPA > 4)
           throw new IllegalArgumentException("Error: Invalid GPA");
    	gpa = theGPA;
    }
    
    
    // toString and equals methods:
    
    public String toString(){
    	
    	
    	return "ID: " + studentID + ", Name: " + studentName + ", Major: " + major + ", GPA: " + gpa;
    }
    
    public boolean equals(Object obj){
    	
    	if(obj == null)
    		return false;
    	else if(getClass() != obj.getClass())
    		return false;
    	else{
    		Student theStudent = (Student)obj;
    		return this.studentID == theStudent.studentID;
    	}	    
    }     
}